package com.spring.mvc.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

/**
 * Created by aivin on 2018/1/29.
 */
@Controller
@RequestMapping(value = "/")
public class LoginController {

    @RequestMapping("/viewAll")
    public ModelAndView viewAll(String name, String pwd) {
        ModelAndView mv = new ModelAndView();
        System.out.println("进入控制器的ViewAll方法");
        System.out.println("name=" + name);
        System.out.println("pwd=" + pwd);
        mv.setViewName("home");
        mv.addObject("msg","从viewAll方法传回视图的数据");
        return mv;
    }


}
